<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
        content="width=device-width,initial-scale=1.0,viewport-fit=cover,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
    <title>尤迈桃李会</title>
    <script src="js/rem.js"></script>
    <link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css" />
    <link rel="stylesheet" href="css/weui.min.css">
    <link rel="stylesheet" href="css/jquery-weui.min.css">
    <link rel="stylesheet" href="css/public.css">
    <link rel="stylesheet" href="css/ot-doctor-relevant.css">
    <script>(function () { var _53code = document.createElement("script"); _53code.src = "https://tb.53kf.com/code/code/96d8f960b261e49515450f8953b044bc5/1"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(_53code, s); })();</script>
</head>

<body>
    <div class="pub_bar" title="尤迈桃李会" left="back"></div>
    <!--  -->
    <div class="pub-container has-tabbar bgwhite">
        <div class="relevant_msg space-border">
        </div>
        <!-- 医生简介 -->
        <div class="relevant_cont space-border">
            <div class="relevant_cont_p1"><img src="./image/hxl/hxl-doctor09.png" alt="">医生简介</div>
            <div class="relevant_cont_p2 text-cut-two"></div>
            <img class="relevant_cont_more" src="./image/hxl/hxl-bottom.png" alt="">
        </div>
        <!-- 医生相关 - 开始听课 -->
        <div class="hxl_tabs space-border">
            <div class="tabs_item active">医生相关</div>
            <div class="tabs_item">开始听课</div>
        </div>
        <!-- 列表 -->
        <div class="relevant_listing">
            <div class="relevant_list relevant_relevant relevant_list1" style="display: block;">
                <div class="pub_small_header plr15">
                    <a href="#">
                        <div class="title">精彩瞬间</div>
                        <div class="right">共有<span></span>节系列课程<img src="./image/hxl/hxl-right.png" alt=""></div>
                    </a>
                </div>
            </div>
            <div class="relevant_list relevant_listen relevant_list2">
            </div>
        </div>
        <div class="weui-loadmore loadMore">
            <i class="weui-loading"></i>
            <span class="weui-loadmore__tips">正在加载</span>
        </div>
        <div class="weui-loadmore weui-loadmore_line noMore hide">
            <span class="weui-loadmore__tips">没有更多数据了</span>
        </div>
    </div>
    <!-- 公共footer -->
    <div class="pub-footer">
        <ul class="tabs">
            <li class="tab-classroom"><a href="./ot-classroom-index.html">首页</a></li>
            <li class="tab-doctor active"><a href="./ot-doctor-index.html">名医</a></li>
            <li class="tab-curriculum"><a href="./ot-curriculum-index.html">课程</a></li>
            <li class="tab-forum"><a href="./classroom-index.html">讲堂</a></li>
            <li class="tab-consultation"><a href="consultation-index.html">会诊</a></li>
            <li class="tab-user"><a href="user.html">我的</a></li>
        </ul>
    </div>
    <script src="https://g.alicdn.com/de/prismplayer/2.9.3/aliplayer-h5-min.js"></script>
    <script src="js/jquery-3.6.0.min.js"></script>
    <script src="js/jquery-weui.min.js"></script>
    <script src="js/md5.js"></script>
    <script src="js/public.js"></script>
    <script>
        let doctor = getQueryString('doctor')
        let type = getQueryString('type')
        let page = 0
        let pages = 0

        $('.hxl_tabs .tabs_item').eq(type).trigger('click')

        $(document).on('click', '.relevant_cont_more', function () {
            if ($(this).prev().hasClass('active')) {
                $(this).removeClass('active')
                $(this).prev().removeClass('active')
            } else {
                $(this).addClass('active')
                $(this).prev().addClass('active')
            }
        })

        // 获取开始听课
        getCourses(1)
        function getCourses(type) {
            if (type) {
                loading = false
            }
            $(".loadMore").removeClass('hide')
            gethttp('/ld/courses?type=c:doctor', {
                data: {
                    doctor: doctor,
                    index: page * 10,
                    count: 10,
                },
                success: function (res) {
                    let doctor = res.data.doctor
                    let list = res.data.list
                    let arr = []

                    $('.relevant_msg').html(`<div class="relevant_msg_p1">${doctor.learnCountUi}人正在学习｜${doctor.playCountUi}播放｜${doctor.createdAtUi}上线</div>
                                            <div class="relevant_msg_p2">${doctor.name ? doctor.name : ''} ${doctor.competent.name ? doctor.competent.name : ''}</div>
                                            <div class="relevant_msg_p3">${doctor.hospital.name ? doctor.hospital.name : ''} ${doctor.depart.name ? doctor.depart.name : ''}</div>
                                            <div class="relevant_msg_p4">${doctor.labelsUi.join(',')}</div>`)
                    $('.relevant_cont_p2').html(doctor.desciption)

                    list.forEach((item, index) => {
                        let html = `<a href="./ot-classroom-play.html?doctor=${item.doctor}?courseId=${item.id}">
                                        <div class="item space-border">
                                            <div class="item_img">
                                                <img src="${item.coverUrlUi}" alt="">
                                                <p>共${item.serieCount}系列</p>
                                            </div>
                                            <div class="item_cont">
                                                <p class="item_p1">${item.name}</p>
                                                <div class="item_msg">
                                                    <p>${item.createdAtUi}</p>
                                                    <div><img src="./image/hxl/hxl-doctor08.png" alt="">${item.likeCountUi}</div>
                                                </div>
                                            </div>
                                        </div>
                                    </a>`
                        arr.push(html)
                    });

                    page == 0 ? $('.relevant_list2').html(arr) : $('.relevant_list2').append(arr)
                    if (list.length < 10) {
                        $(".noMore").removeClass('hide')
                        loading = true;
                    } else {
                        loading = false;
                    }
                    $(".loadMore").addClass('hide')
                }
            })
        }

        // 获取医生相关
        getVideos(1)
        function getVideos(type) {
            if (type) {
                loading = false
            }
            $(".loadMore").removeClass('hide')
            gethttp('/ld/videos?type=c:doctor', {
                data: {
                    doctor: doctor,
                    index: pages * 10,
                    user: getCookie('userId'),
                    count: 10,
                },
                success: function (res) {
                    let doctors = res.data.doctor
                    let list = res.data.list
                    let arr = []
                    $('.pub_small_header .right span').html(doctors.courseCountUi)

                    list.forEach((item, index) => {
                        let html = `<div class="item space-border">
                                    <a href="./ot-doctor-video.html?doctor=${item.doctor}&course=${item.course}">
                                        <div class="item_img">
                                            <img src="${item.coverUrl}" alt="">
                                            <p class="hide">开讲时间:2021/02/20/13:00-16:00</p>
                                        </div>
                                        <div class="item_cont">
                                            <p class="text-cut-one">${item.lessonName}</p>
                                            <div><img src="./image/hxl/hxl-doctor08.png" alt="">${item.likeCountUi}</div>
                                        </div>
                                    </a>
                                </div>`
                        arr.push(html)
                    });

                    pages == 0 ? $('.relevant_list1').html(arr) : $('.relevant_list1').append(arr)
                    if (list.length < 10) {
                        $(".noMore").removeClass('hide')
                        loading = true;
                    } else {
                        loading = false;
                    }
                    $(".loadMore").addClass('hide')
                }
            })
        }

        // 初始化加载更多
        var loading = false
        $(document.body).infinite().on("infinite", function () {
            if (loading) return;
            loading = true;
            status == 0 ? page = Number(page) + 1 : pages = Number(pages) + 1
            status == 0 ? getCourses() : getVideos();
        });
    </script>
</body>

</html>